package com.zhou.JavaAndroidFirm.presenter;

import com.zhou.JavaAndroidFirm.constract.VideoListContract;
import com.zhou.JavaAndroidFirm.rx.RxSubscriber;
import com.jaydenxiao.androidfire.bean.VideoData;

import java.util.List;

/**
 * @author Administrator
 * @date 2018/7/18 0018
 * @des
 */
public class VideoListPresenter extends VideoListContract.Presenter {
    @Override
    public void getVideosListData(String type, int startPage) {
        addSubscribe(mModel.getVideosListData(type, startPage).subscribe(new RxSubscriber<List<VideoData>>(mContext, false) {
            @Override
            protected void _onNext(List<VideoData> videoData) {
                mView.returnVideosListData(videoData);
            }

            @Override
            protected void _onError(String message) {
                mView.showTip(message);
            }
        }));
    }
}
